<?php
abstract class GcalEventsDisplay
{

	function getEvents($params)
	{
		extract($params, EXTR_SKIP);

		$calID = $params['id']; 
		$maxEvents = $params['maxevents'];

		$feed = "http://www.google.com/calendar/feeds/" . $calID . "/public/full?";
		$gcal_params = "orderby=". $params['orderby'] 
			. "&sortorder=" . $params['sortorder'] 
			. "&futureevents=true";

		$contents = @file_get_contents($feed . $gcal_params) or die(__('Bad request'));
		$xml = new SimpleXmlElement($contents);

		$this->displayEvents ($xml, $maxEvents, $calID);
		
	}

	abstract function displayEvents ($xml, $maxEvents, $calID);
}

?>